package twitter.RequestParser;

import java.util.StringTokenizer;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

import Twitter.RequestSender.RequestSender;

import twitter.Server.ServerType;
import twitter.TwitterLibrary.SocketConfig;
import twitter.TwitterLibrary.Utility;


public class ServerRegistrateNoticeParser {
	//private ServerType type;
	private Utility utility;
	private RequestSender sender;
	public ServerRegistrateNoticeParser(Utility utility)
	{
		this.utility=utility;
		sender=new RequestSender(utility);
		//this.type=type;
	}
	public String readQuery(String query)
	{
		
	/*	synchronized(this)
		{
			SocketConfig.primaryIp=primaryIp;
			SocketConfig.primaryNotificationPort=Integer.parseInt(st.nextToken());
		}
			*/
		utility.readServers(query);
		
		String result="";
		
		if(SocketConfig.serverType==ServerType.PrimaryServer)
		{
			result=utility.constructNotice(true);
		}
		else
		{
			result=utility.constructNotice(false);
		}
		return result;
	}

}
